﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ALiteTeam.PackageTracer.Data;

namespace ALiteTeam.PackageTracer.Core
{
    public interface IOrderOperate
    {
        void AddOrder(DeliveryOrder order);

        /// <summary>
        /// 保存一个DeliveryOrder对象
        /// </summary>
        /// <param name="order"></param>
        void UpdateOrder(DeliveryOrder order, bool isDetached = false);

        /// <summary>
        /// 根据ID加载一个DeliveryOrder对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        DeliveryOrder GetOrderByID(Guid id);

        /// <summary>
        /// 删除一个DeliveryOrder对象
        /// </summary>
        /// <param name="id"></param>
        void DeleteOrder(DeliveryOrder order);

        /// <summary>
        /// 获取所有当前需要后台更新的运单
        /// </summary>
        /// <returns></returns>
        IList<DeliveryOrder> GetQueueForRefresh();

        IList<DeliveryOrder> GetAll();
    }
}
